/*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-06-28 15:47:29
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-09-01 17:28:03
 * @FilePath: /server/workspace/tests/test_fiber.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"../src/base/marco.h"
#include"../src/base/fiber.h"
#include "base/Log.h"

void test(){
    SERVER_LOG_DEBUG(SERVER_LOG_ROOT())<<"hello";
    Yizhi::Fiber::YieldToReady();
    SERVER_LOG_DEBUG(SERVER_LOG_ROOT())<<"test end";

}
int main(){
    Yizhi::Fiber::GetThis();
    Yizhi::Fiber::ptr f(new Yizhi::Fiber(test));
    {
        f->call();
        SERVER_LOG_DEBUG(SERVER_LOG_ROOT())<<"world";
        f->call();
    }
    SERVER_LOG_DEBUG(SERVER_LOG_ROOT())<<"end";

 
}